import Taro, { Component } from "@tarojs/taro";
import Index from "./pages/index";
import "taro-ui/dist/style/index.scss"; // 引入组件样式 - 方式一
import "./app.less";

// 如果需要在 h5 环境中开启 React Devtools
// 取消以下注释：
// if (process.env.NODE_ENV !== 'production' && process.env.TARO_ENV === 'h5')  {
//   require('nerv-devtools')
// }

class App extends Component {
  config = {
    pages: [
      "pages/formPage/index",
      "pages/main/index",

      "pages/userPage/index",
      "pages/articleDetail/index",
      "pages/userPage/component/about/index",
      "pages/userPage/component/setting/index",
      "pages/userPage/component/feedback/index"
    ],
    window: {
      backgroundTextStyle: "light",
      navigationBarBackgroundColor: "#fff",
      navigationBarTitleText: "WeChat",
      navigationBarTextStyle: "black"
    },
    tabBar: {
      backgroundColor: "#fff",
      color: "#999",
      selectedColor: "#1980ff",
      borderStyle: "white",

      list: [
        {
          pagePath: "pages/main/index",
          text: "首页",
          iconPath: "assets/images/home-unselected.png",
          selectedIconPath: "assets/images/home-selected.png"
        },
        {
          pagePath: "pages/formPage/index",
          text: "咨询",
          iconPath: "assets/images/class-unselected.png",
          selectedIconPath: "assets/images/class-selected.png"
        },
        {
          pagePath: "pages/userPage/index",
          text: "用户",
          iconPath: "assets/images/user-unselected.png",
          selectedIconPath: "assets/images/user-selected.png"
        }
      ]
    }
  };

  componentDidMount() {}

  componentDidShow() {}

  componentDidHide() {}

  componentDidCatchError() {}

  // 在 App 类中的 render() 函数没有实际作用
  // 请勿修改此函数
  render() {
    return <Index />;
  }
}

Taro.render(<App />, document.getElementById("app"));
